﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>积分商城</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="keywords" content="销冠,TopSales微信" />
    <meta name="description" content="销冠,TopSales微信,TopSales销冠" />
    <meta http-equiv="Access-Control-Allow-Origin" content="*" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Pragma" content="no-cache" />
    <base href="http://static.tops001.com/pointstore/" />
    <link href="css/main.css?t=1" rel="stylesheet" type="text/css" />
</head>
<body style="position:relative;">
    <div>
        <img src="images/bg-cj.png" alt="" style="width:100%" />
    </div>
    <!-- 这次七夕节删除部分
    <div class="top_title">
        <img src="images/luck_top.png" alt="" width="175" />
    </div>
    -->
    <div class="start_tip">
        <img src="images/start_bg.png?t=22333" alt="" style="width:100%;" />
    </div>
    <div class="start_con">
        <div class="">
            <img src="images/zp-cj.png" alt="" style="width:82%" id="rotaryArrow" />
        </div>
    </div>
    <div class="start_edge">
        <div>
        </div>
    </div>
    <div class="start_btn rotaryBtn">
        <img src="images/an-cj.png" class="start_btn_on" alt="" style="width:22%;" />
        <img src="images/an2-cj.png" class="start_btn_off" alt="" style="width:22%;display:none;" />
    </div>
    <div class="start_bottom"></div>
    <div class="bottom_title">
        <!--
            这次七夕节删除部分<img src="images/copyright.png" alt="" width="180" />
        -->
        <span>该活动最终解释权归销冠所有</span>
    </div>
    <div class="peo_list">
        <div class="peo_top">
            <div class="peo_left"></div>
            <div class="peo_right"><a class="peo_a" onclick="openRule()"></a></div>
        </div>
        <div class="peo_mid">
            <div class="peo_mid_title">
                <ul>
                    <li class="sort01">幸运星</li>
                    <li class="sort02">所属公司</li>
                    <li class="sort03">红包</li>
                </ul>
            </div>
            <div class="peo_mid_con list_lh">
                <ul style="height:300px;"></ul>
            </div>
        </div>
    </div>
    <div class="cover">
    </div>
    <div class="fade_box">
        <div class="fade_rule">
            <div class="fade_rule_top">活动内容</div>
            <div class="fade_rule_con">
                <div class="con_strong">哔哔哔！积分商城有万元红包出没  !  </div>
                <div class="con_line">有些人花心思用“皂骗”骗不到红包，</div>
                <div class="con_line">用微信摇半天摇不到五毛钱，</div>
                <div class="con_line">而有些人逛个积分商城就赚回了回家的路费。</div>
                <div class="con_line">对于那些连五毛钱都摇不到的旁友们，弱弱问一句：手酸吗？</div>
                <div class="con_line">除夕夜，销冠让你彻底解放双手，积分商城免费送红包咯！</div>
                <div class="con_line">任性的霸道总裁就爱撒个几万元在商城，有强迫症的程序猿哥哥就要人人有惊喜！！！不用使劲摇，不用拼命按，只需轻轻点下屏幕，红包就到手啦！新春新禧，欢乐不停，销冠与你闹除夕！</div>
                <div class="con_line">时间是</div>
                <div class="con_line">2016年2月8日0点整！</div>
                <div class="con_line">2016年2月8日0点整！</div>
                <div class="con_line">2016年2月8日0点整！</div>
                <div class="con_line">重要的事情要说三遍，积分商城大转盘等着你！听说颜值高的都拿的到，拼手气什么的这都不是事儿啊！</div>
                <div class="con_line">感谢这一年各位小伙伴们对销冠的支持，提前预祝大家新春新禧，阖家欢乐！</div>
                <div class="con_strong">温馨提示:</div>
                <div class="con_line">•&nbsp;1、新年幸运大转盘抢红包，每个用户仅可免费参与1次。</div>
                <div class="con_line">•&nbsp;2、中奖红包可在 “钱包”中查看，1日之内到账，节后可提现哦。</div>
                <div class="con_line">•&nbsp;3、如有疑义，您可直接拨打4008-125-121与我们的客服取得联系。</div>
                <div class="con_line">•&nbsp;4、本活动最终解释权归销冠所有。</div>
            </div>
        </div>
        <div class="fade_close" onclick="closeRule()">
        </div>
    </div>
    <div class="fade_sure">
        <div class="fade_top">
            <img src="images/icon_02.png" width="75" alt="" />
        </div>
        <!--<div class="fade_price">本次抽奖消耗<span class="F_PointNum" id="F_PointNum">50</span>积分,是否继续?</div>-->
        <div class="fade_price">开始抢红包啦，准备好了吗？</div>
        <div class="fade_btn">
            <button class="fade_canceal" onclick="f_No()">取消</button>
            <button class="fade_ok rotarySure">确定</button>
        </div>
    </div>
    <div class="fade_again">
        <div class="result" id="result" style="">
            <p class="resultTxt" style="padding: 8px;"></p>
        </div>
        <div class="fade_btn">
            <button class="fade_on rotarySure">确定</button>
        </div>
    </div>
    <div class="fade_fin">
        <div class="result" id="result" style="">
            <p class="resultTxt"></p>
        </div>
        <div class="fade_btn">
            <button class="fade_on" onclick="f_Go()">我知道了</button>
        </div>
    </div>
    <div class="fade_err">
        <div class="fade_price err_txt" style="margin-top:20px">
            新年快乐
        </div>
        <div class="fade_btn">
            <button class="fade_on" onclick="f_Go()">我知道了</button>
        </div>
    </div>
    <div class="fade_out">

    </div>
    <script src="js/jquery-1.8.3.min.js?t=1" type="text/javascript"></script>
    <script src="js/jquery.rotate.min.js?t=1" type="text/javascript"></script>
    <script src="js/common.js?t=1" type="text/javascript"></script>
    <script type="text/javascript" src="js/scroll.js?t=1"></script>
    <script src="../kk.js"></script>
    <script type="text/javascript">

    </script>
    <script type="text/javascript">
        var apiUrl = "http://"+window.location.host+"/";
        var brokerKid = GetUrlParam("BrokerKid");

        $(function () {
            $('.list_lh li:even').addClass('lieven');

            $("div.list_lh").myScroll({
                speed: 40, //数值越大，速度越慢
                rowHeight: 26 //li的高度
            });

            getAward();
        });

        function getAward() {
            //获取中奖明细
            $.getJSON(apiUrl + "/luckbigturntable/GetLuckRecoredList", { brokerKid: brokerKid }, function (data) {
                var res = data.Data;
                //$(".start_bottom").text("已有" + data.Data.length + "人中奖");
                for (var i = 0; i < res.length; i++) {
                    var company = res[i].F_CompanyName.substr(0, 5) + "...";
                    htm = "<li>" +
                        "    <div class='sort01'>" + res[i].UserName + res[i].PhoneNumber + " </div> " +
                        "    <div class='sort02'>" + company + "</div>" +
                        //"    <div class='sort03'>" + getname(res[i].LuckProductKid, res[i].F_ProductName) + "</div>" +
                        "    <div class='sort03'>" + res[i].F_ProductName + "</div>" +
                        "</li>";
                    $(".peo_mid_con ul").append(htm);
                }
            });
            $.getJSON(apiUrl + "/luckbigturntable/GetLuckRecordCount", {}, function (data) {
                $(".start_bottom").text("已有" + data.Data + "人抢到红包");
            })
        }

        function getname(id, name) {
            if (id == 47) {
                return "0.52元";
            } else if (id == 46) {
                return "5.2元";
            } else if (id == 45) {
                return "52元";
            } else if (id == 44) {
                return "520元";
            } else {
                return name;
            }
        }

        var sum = 0;
        setInterval(function () {
            var n = sum % 2;
            switch (n) {
                case 0: $(".start_edge").children("div").removeClass("edge_bg01").addClass("edge_bg02"); break;
                case 1: $(".start_edge").children("div").removeClass("edge_bg02").addClass("edge_bg01"); break;
            }
            sum++;
        }, 600);

        function startSure() {
            $(".cover").hide();
            $(".fade_again").hide();
            $(".fade_sure").hide();
            $(".fade_out").show();
        }
        function f_No() {
            $(".cover").hide();
            $(".fade_again").hide();
            $(".fade_sure").hide();
            $(".fade_fin").hide();
            $(".fade_err").hide();
            $(".start_btn_off").hide();
            $(".start_btn_on").show();
        }

        function f_Go() {
            f_No();
            //location.href = apiUrl + "change_histroy.html";
        }

        //中奖提示
        function Funfin() {
            $(".cover").show();
            //$(".fade_fin").show();
            $(".fade_out").hide();
        }
        //抽奖失败
        function Funerr() {
            $(".cover").show();
            $(".fade_err").show();
            $(".fade_out").hide();
        }

        //活动规则开启
        function openRule() {
            $(".cover").show();
            $(".fade_box").show();
        }
        function closeRule() {
            $(".cover").hide();
            $(".fade_box").hide();
        }

        function GetIsDistribute() {
            $.getJSON(apiUrl + "/Login/GetIsDistribute", function (data) {
                if (data.Data) {
                    $("#F_PointNum").html(1000);
                }
            });
        }


        var lottery_finished = true;

        $(".start_btn img").on('click', function () {
            if (lottery_finished) {
                $(".start_btn_on").hide();
                $(".start_btn_off").show();
                $(".cover").show();
                $(".fade_sure").show();

            } else {
                return;
            }

        });

        //转盘旋转
        $(function () {
            var $rotaryArrow = $('#rotaryArrow');
            var $result = $('#result');
            var $resultTxt = $('.resultTxt');
            var $resultBtn = $('#result');
            var $rotaryBtn = $('.rotaryBtn');
            var $rotarySure = $('.rotarySure');
            var $Kid;
            var $Angle;
            var $Name;
            $rotarySure.click(function () {

                lottery_finished = false;
                $(".start_btn_on").hide();
                $(".start_btn_off").show();
                startSure();

                $.getJSON(apiUrl + "/luckbigturntable/turn", { timestamp: Math.round(new Date().getTime() / 1000) }, function (data) {
                    if (data.Code == 0) {
                        var res = data.Data.LuckProduct;
                        $Kid = res.Kid;
                        $Angle = res.Angle;
                        $Name = res.Name;
                        $Description = res.Description;
                        if (data.Data.State <= 0) {
                            $(".err_txt").text(data.Data.Message);
                            lottery_finished = true;
                            Funerr();
                            return;
                        }
                        rotateFunc($Kid, $Angle, $Description);
                        lottery_finished = true;
                    }
                    else if (data.Code == 4002) {
                        $resultTxt.html("出问题啦,请重新打开积分商城吧");
                        setTimeout(function () {
                            Funfin(); $(".fade_fin").show();
                            $(".start_btn_off").hide();
                            $(".start_btn_on").show();
                            lottery_finished = true;
                        }, 200);
                    }
                });

            });

            var rotateFunc = function (awards, angle, text) {  //awards:奖项，angle:奖项对应的角度
                $rotaryArrow.stopRotate();
                $rotaryArrow.rotate({
                    angle: 0,
                    duration: 4000,
                    animateTo: angle + 2160,
                    callback: function () {
                        //if (angle == 135) {
                        //    //处理再来一次，再次抽奖
                        //    $resultTxt.html(text);
                        //    setTimeout(function () { Funfin(); $(".fade_again").show(); $(".start_btn img").attr("src", "images/start.png"); }, 200);
                        //}
                        //else {
                            $resultTxt.html(text);
                            $result.show();
                            setTimeout(function () { Funfin(); $(".fade_fin").show(); $(".start_btn_off").hide(); $(".start_btn_on").show(); lottery_finished = true; }, 200);
                        //}
                    }
                });
            };

        });
    </script>
</body>
</html>
